package com.myh.gulimall.authserver.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @Description: // 类说明，在创建类时要填写
 * @ClassName: UserRegistVo    // 类名，会自动填充
 * @Author: MYH          // 创建者
 * @Date: 2024/6/4 15:42   // 时间
 * @Version: 1.0     // 版本
 */
@Data
public class UserRegistVo {

    @NotBlank(message = "用户名必须提交")
    @Length(min = 6, max = 18, message = "用户名长度必须在6-18位")
    private String userName;

    @NotBlank(message = "密码必须提交")
    @Length(min = 6, max = 18, message = "密码长度必须在6-18位")
    private String password;

    @NotBlank(message = "手机号必须提交")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号格式不正确")
    private String phone;

    @NotBlank(message = "验证码必须提交")
    private String code;
}
